home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / asm_subr.arc / FPTNORM < prev    next >
Encoding:
Text File  |  1985-12-25  |  1.4 KB  |  46 lines

  1. ;-------------------------fptnorm routine begins--------------------------+
  2. ; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
  3. ;         page : 84
  4. ;
  5. ; NAME FPTNORM
  6. ; ROUTINE FOR NORMALIZATION OF TEMPORARY FLOATING POINT
  7. ;
  8. ; FUNCTION: This routine normalizes temporary binary floating point
  9. ; numbers that have too large a mantissa.
  10. ;
  11. ; INPUT: Upon entry DS:DI points to a temporary binary floating point
  12. ; number whose mantissa is too large
  13. ;
  14. ; OUTPUT: Upon exit DS:DI points to a normalized temporary binary floating
  15. ; point number.
  16. ;
  17. ; REGISTERS USED:  No registers are modified.  DI must point to the number
  18. ;
  19. ; SEGMENTS REFERENCED:  The data segment must contain the temporary
  20. ; floating point number.
  21. ;
  22. ; ROUTINES CALLED:  None
  23. ; SPECIAL NOTES: Equates are used to shorten address fields.  This is a
  24. ; near procedure needed by FPIN.
  25. ;
  26. ; ROUTINE TO NORMALIZE TEMP FLO-ATING POINT NUMBERS THAT HAVE TOO LARGE
  27. ; A MANTISSA.
  28. ;
  29. fptnorm    proc    near
  30. ;
  31.     cmp    diword+8,100h    ; test if too high
  32.     jl    fptnorm1    ; exit if low enough
  33.     sar    diword+8,1    ; shift right all bytes
  34.     rcr    diword+6,1    ; carry on
  35.     rcr    diword+4,1
  36.     rcr    diword+2,1
  37.     rcr    diword+0,1
  38.     inc    diword+11    ; increment exponent
  39.     jmp    fptnorm
  40. ;
  41. fptnorm1:
  42.     ret            ; return
  43. ;    
  44. fptnorm    endp
  45. ;-------------------------fptnorm routine ends---------------------------+
  46.